package com.niit.scs.server.doc;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.elasticsearch.annotations.*;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
import org.springframework.data.geo.Point;

import javax.persistence.Id;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Date;

@Document(indexName = "content001",type = "doc", shards = 1, replicas = 0)
public class EsContentInfo {
    @Id
    private Long id;
    @Field(type= FieldType.Text,analyzer = "ik_max_word")
    private String contenttext;
    @Field(type=FieldType.Long)
    private Long favoritecount;
    @Field(type=FieldType.Long)
    private Long commentcount;
    @Field(type=FieldType.Long)
    private Long praisecount;
    @Field(type=FieldType.Keyword)
    private String contentauthor;
    @Field(type=FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date contenttime;
    @Field(type=FieldType.Text)
    private String contentimg;
    @GeoPointField
    private GeoPoint contentposition;

    public GeoPoint getContentposition() {
        return contentposition;
    }

    public void setContentposition(GeoPoint contentposition) {
        this.contentposition = contentposition;
    }

    public String getContentimg() {
        return contentimg;
    }

    public void setContentimg(String contentimg) {
        this.contentimg = contentimg;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getContenttext() {
        return contenttext;
    }

    public void setContenttext(String contenttext) {
        this.contenttext = contenttext;
    }

    public Long getFavoritecount() {
        return favoritecount;
    }

    public void setFavoritecount(Long favoritecount) {
        this.favoritecount = favoritecount;
    }

    public Long getCommentcount() {
        return commentcount;
    }

    public void setCommentcount(Long commentcount) {
        this.commentcount = commentcount;
    }

    public Long getPraisecount() {
        return praisecount;
    }

    public void setPraisecount(Long praisecount) {
        this.praisecount = praisecount;
    }

    public String getContentauthor() {
        return contentauthor;
    }

    public void setContentauthor(String contentauthor) {
        this.contentauthor = contentauthor;
    }

    public Date getContenttime() {
        return contenttime;
    }

    public void setContenttime(Date contenttime) {
        this.contenttime = contenttime;
    }
}
